using UnityEngine;
using UnityEngine.Rendering;

public class transDoorDisappear : MonoBehaviour
{
    Transform objTransform = null;

    public GameObject Obj;

    public float _morez2Disapper =  -34.4f;

     private MeshRenderer render;

    public void Start()
    {
        objTransform = Obj.transform;
        render =  Obj.GetComponent<MeshRenderer>();
    }

    private void Update() {
        render.enabled = (objTransform.position.z < _morez2Disapper);
    }

}